package com.yc.damai.damaiindex.web.fegin;

import com.yc.damai.bean.Result;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/9/6
 * Email haijunzhou@hnit.edu.cn
 */
@Component
public class UserActionImpl implements UserAction{
    @Override
    public String user() {
        return "服务降级: user";
    }

    @Override
    public String hello(String name) {
        return " hello " + name;
    }

    @Override
    public int add(int a, int b) {
        return a + b + 1000;
    }

    @Override
    public String sub(int x, int y) {
        return "服务降级: " + (x - y - 1000);
    }

    @Override
    public Result result(Result result) {
        result.setCode(9999);
        result.setMsg("服务降级: " + result.getMsg());
        return result;
    }

}
